home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
1463.ZIP
/
DRAW-2D.ARC
/
GETMRG.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-11-29
|
1KB
|
44 lines
PROCEDURE GETMRG(VAR K:INTEGER);
VAR
T:CHAR;
M,J:INTEGER;
FLAG:BOOLEAN;
MSG:SCRLINE;
BEGIN
K := 0;
FLAG := TRUE;
WHILE FLAG DO
BEGIN
FLAG := FALSE;
MSG := 'Enter Drawing File Name (or CR to quit) >> ';
DFILE := ASKSTR(23,2,1,MSG,' ',' ','');
IF LENGTH(DFILE) <> 0 THEN
BEGIN
J := POS('.',DFILE);
IF J=0 THEN DFILE := DFILE + TP;
ASSIGN(DRAWFIL,DFILE);
{$I-}
RESET(DRAWFIL);
{$I+}
IF IORESULT = 0 THEN
BEGIN
M := FILESIZE(DRAWFIL);
IF (OBJPTR - 1 + M) <= MAXSIZE THEN
BEGIN
FOR J := 1 TO M DO
BEGIN
READ(DRAWFIL,DRAWREC);
DRAWARY[OBJPTR + J - 1] := DRAWREC;
END;
OBJPTR := OBJPTR + M;
END
ELSE K := 2; (* NOT ENOUGH ROOM FOR MERGE FILE *)
CLOSE(DRAWFIL);
END
ELSE
K := 1; (* MERGE FILE NOT FOUND *)
END
ELSE
K := 1; (* CR for QUIT *)
END; (* WHILE *)
END; (*PROC*)